from Core.Config import *
import pandas as pd

config = Config()
database1 = config.Mysql()
database2 = config.DataBase()
b = database2.Find("Recommender", "Article", filter={"skip": 50000, "limit": 100000})
a = database1.Find("rec_article","article_publish")
print("ready")
articles = {}

debug = 1
pairing = []
articles = {}
for i in range(len(a)):
    article_id_test =  a[i]["id"]
    content =  a[i]["content"]
    for j in range(len(b)):
        if b[j]["content"] == content:
            article_id_pro = b[j]["id"]
            if article_id_pro not in articles:
                articles[article_id_pro] = article_id_test
                pairing.append([article_id_test, article_id_pro])
                c = b[j]
                print(article_id_test, article_id_pro)
            continue








name=['test','producting']
test=pd.DataFrame(columns=name,data=pairing)
test.to_csv(r'D:/test2csv.csv',encoding='gbk')